package yyy.ab.modules.security.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@Data
@Configuration
@ConfigurationProperties(prefix = "ab.security")
public class AbSecurityProperties {

    /* 系统登录的URL */
    private String loginUrl;
    /* 系统登录成功跳转的URL */
    private String loginSuccessUrl;
    /* 系统登录失败的URL */
    private String loginErrorUrl;
    /* 系统登出的URL */
    private String logoutUrl;
    /* 过滤的对象 */
    private IgnoredUrlsProperties ignored;
    /* Session对象 */
    private SessionProperties session;

    private ValidateCodeProperties code = new ValidateCodeProperties();

    @Data
    public static class IgnoredUrlsProperties {
        // 过滤的URL集合
        private List<String> urls = new ArrayList<>();
    }

    @Data
    public static class SessionProperties {
        // 最大并发登录数量，默认值为-1，表示无限制
        private Integer maximumSessions = -1;
    }
}
